package com.springcloud.consumercourse.myinterface;

import com.entity.Course;
import com.entity.ResponseResultSet;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author
 * @create 2020-11-10 22:30
 *通过实现接口实现统一的降级处理方法
 */
//自动创建类对象
@Component
public class CourseOpenFeignFallBack
        implements CourseOpenFeignClient{

    @Override
    public ResponseResultSet<Course> getOneCourse(Integer cid) {
        return null;
    }

    @Override
    public ResponseResultSet<List<Course>> getCourses() {
        return null;
    }

    @Override
    public ResponseResultSet addCourse(Course course) {
        return null;
    }

    @Override
    public ResponseResultSet timeOut() {
        ResponseResultSet resultSet = new ResponseResultSet(500,"error","timeOutFallBack");
        return resultSet;
    }

    @Override
    public ResponseResultSet Ok() {
        ResponseResultSet resultSet = new ResponseResultSet(500,"error","okFallBack");
        return resultSet;
    }

}
